package com.smalls.newvideotwo.view;

import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

import com.smalls.newvideotwo.R;

public class ToastDialog extends Dialog {
    private OnKeyListener keyLister = new OnKeyListener() {
        public boolean onKey(DialogInterface arg0, int arg1, KeyEvent arg2) {
            ToastDialog.this.dismiss();
            return true;
        }
    };
    private TextView tv_loading;

    public ToastDialog(Context paramContext, int style) {
        super(paramContext, style);
        View loadingView = LayoutInflater.from(paramContext).inflate(R.layout.index_error_toast, null);
        this.tv_loading = (TextView) loadingView.findViewById(R.id.tv_smtv_toast);
        setContentView(loadingView);
        setOnKeyListener(this.keyLister);
    }

    public void setShowMsg(int paramInt) {
        this.tv_loading.setText(paramInt);
    }

    public void setShowMsg(String paramString) {
        this.tv_loading.setText(paramString);
    }

    public void setMsgGone() {
        this.tv_loading.setVisibility(View.VISIBLE);
    }
}
